import 'package:flutter/material.dart';

class WorkBenchCardWidget extends StatefulWidget {
  final String background;
  final String title;
  final String route;
  final String image;
  final EdgeInsets margin;
  WorkBenchCardWidget(
      {this.background,
      @required this.title,
      this.margin,
      this.route,
      this.image});

  @override
  State<StatefulWidget> createState() {
    return WorkBenchCardWidgetState();
  }
}

class WorkBenchCardWidgetState extends State<WorkBenchCardWidget> {
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
        child: Container(
          decoration: BoxDecoration(
              image: DecorationImage(
                  image: AssetImage(widget.background),
                  fit: BoxFit.fill)),
          width: double.infinity,
          height: 126,
          child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,children: <Widget>[
            Container(margin: EdgeInsets.only(left: 50),height: 35,width: 39,child: Image.asset(widget.image,fit: BoxFit.fill,),),
            Container(margin: EdgeInsets.only(right: 50),child: Text(widget.title,style: TextStyle(color: Colors.white,fontSize: 21),))
          ],),
        ),
        onTap: () {
          Navigator.pushNamed(context, widget.route);
        });
  }
}
